<template>
    <fieldset>
        <legend>Parent</legend>
        <h1>{{ msg }}</h1>
        <h1>{{name}}:{{gift}}</h1>
        <Child />
    </fieldset>
</template>
<script>
    import Child from "./Child.vue";
    export default {
        data() {
            return {
                name:"佩罗西",
                msg: "一个parent组件",
                gift:"飞机✈"
            };
        },
        components: { Child },
        mounted () {
            this.bus.$on('receive',input=>{
                this.gift = input
            })
        }
    }
</script>